﻿@using Pyramid.Models
@using Pyramid.Mvc.Html
@model  IEnumerable<MemberCenter>
@{
	var bag = (PagerModel)ViewBag.Bag;
	var qm = (MemberQueryModel) ViewBag.QueryModel;
}

@using (Html.BeginForm("AccountList", "MemberCenter", FormMethod.Post, new {id = "pagerForm"}))
{
	<input type="hidden" name="pageNum" value="1" />
	<input type="hidden" name="numPerPage" value="${model.numPerPage}" />
}

<div class="pageHeader">
	@using (Html.BeginForm("AccountList", "MemberCenter", FormMethod.Post, new {onsubmit = "return navTabSearch(this);"}))
	{
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>编码：<input type="text" name="MemberCode" rel="pagerForm" value="@qm.MemberCode" /></td>
					<td>名称：<input type="text" name="Keywords" rel="pagerForm" value="@qm.Keywords" /></td>
				</tr>
			</table>
		</div>
		<div class="subBar">
			<table>
				<tr>
					<td>成立日期从 
						<input type="text" name="EstablishDateFrom" class="date" readonly="readonly" rel="pagerForm" value="@Html.DateString(qm.EstablishDateFrom)" />
						至 
						<input type="text" name="EstablishDateTo" class="date" readonly="readonly" rel="pagerForm"  value="@Html.DateString(qm.EstablishDateTo)"/>
					</td>
					<td>&nbsp;&nbsp;</td>
					<td>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</div>
	}
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="edit" href="@Url.Action("SetAccount", new { memberCenterId = "{id}" })" target="dialog" mask="true" title="设置系统登录账号" width="810" height="480" resizable="false"><span>设置账号</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layouth="138">
		<thead>
			<tr>
				<th width="100">@Html.DisplayNameFor(m=>m.Code)</th>
				<th width="120">@Html.DisplayNameFor(m=>m.Name)</th>
				<th class="x-state-highlight" width="120">@Html.DisplayNameFor(m=>m.UserId)</th>
				<th width="150">@Html.DisplayNameFor(m=>m.EstablishDate)</th>
				<th width="150">@Html.DisplayNameFor(m=>m.Bosshead)</th>
				<th>@Html.DisplayNameFor(m=>m.BossheadIdCard)</th>
			</tr>
		</thead>
		<tbody>
			@foreach (var s in Model)
			{
				<tr target="id" rel="@s.Id">
					<td>@s.Code</td>
					<td>@s.Name</td>
					<td class="x-state-highlight">@(string.IsNullOrWhiteSpace(s.UserId) ? "尚未设定" : s.UserId)</td>
					<td>@s.EstablishDate.ToString("yyyy-MM-dd")</td>
					<td>@s.Bosshead</td>
					<td>@s.BossheadIdCard</td>
				</tr>
			}
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共 @bag.TotalCount 条</span>
		</div>
		<div class="pagination" targettype="navTab" totalcount="@bag.TotalCount" numperpage="@bag.PageSize" pagenumshown="10" currentpage="@bag.CurrentPageIndex"></div>
	</div>
</div>
